<html>
<head>
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p class="heading">
Label element (used with <a href="interfacedoc.html">Interface</a> module)
</p>
<p class="subheading">
Description:
</p>
<p>
This element adds a text label to an interface. The font, size, color, border and background colours
can all be customized, before or after adding the label to an interface.
</p>
<p class="subheading">
To use:
</p>
<p>
The code for this element is included in the <a href="interfacedoc.html">interface module</a>,
linked as follows:
</p>
<p class="jcode">
&lt;script language="Javascript" src="gamelib_interface.js"&gt;&lt;/script&gt;
</p>
<p>
It's very easy to use this element; you just place it in the interface like so:
</p>

<p class="jcode">
&nbsp;	myLabel=new In_Label(10,20,200,50,'Some text!','center','#000000',3,'Arial','#0000ff','#aaaaaa');<br />
&nbsp;	myInterface.add(myLabel);
</p>

<p>
There are 11 parameters passed to this object. These are:<br />
(1,2) x,y (position relative to interface top left corner)<br />
(3,4) width,height<br />
(5) text for the label,<br />
(6) alignment of the text ('center'|'left'|'right') or if null, it will default to left<br />
(7) color of label text<br />
(8) font size for label (1-7)<br />
(9) font face for label (if null, then Arial,Helvetica,sans-serif is used)<br />
(10) border color (if null, there is no border OR background color)<br />
(11) background color (if null, there is no background or border color)
</p>

<p>
Any of the properties for a label (excluding position) may be changed at any time.
</p>

<p class="subheading">
List of methods for Label
</p>

<p>
<a href="#setAlignment">setAlignment</a><br>
<a href="#setBackgroundColor">setBackgroundColor</a><br>
<a href="#setBorderColor">setBorderColor</a><br>
<a href="#setFontColor">setFontColor</a><br>
<a href="#setFontFace">setFontFace</a><br>
<a href="#setFontSize">setFontSize</a><br>
<a href="#setText">setText</a><br>
</p>

<p class="subheading">
Descriptions of methods for Label
</p>

<table>
<tr>
<th>Method</th><th NOWRAP>Parameters</th><th>Description</th>
</tr>

<tr>
<a name="setAlignment">
<td>setAlignment</td><td>String ('left', 'right' or 'center')</td><td>
Sets the horizontal alignment of the label inside its own box (set by
the x,y position and width,height dimensions.) This alignment can only
be 'left', 'right' or 'center'. If any other value is passed, it will
default to 'left'.
</td>
</tr>

<tr>
<a name="setBackgroundColor">
<td>setBackgroundColor</td><td>Color</td><td>
Sets the background color for the label. This will fill the box the
label occupies in the interface. Note: The border color must also be
set for this to display. If you don't want a border of a different
color to the background, just set the border to the same color! If the
boolean value false is sent as the parameter to this method, the background
color will disappear.
</td>
</tr>
<tr>
<a name="setBorderColor">
<td>setBorderColor</td><td>Color</td><td>
Sets the border color for the label. If the parameter passed is the
boolean value false, then there will be no border.
</td>
</tr>
<tr>
<a name="setFontColor">
<td>setFontColor</td><td>Color</td><td>
This sets the color of the label text.
</td>
</tr>
<tr>
<a name="setFontFace">
<td>setFontFace</td><td>String</td><td>
This sets the font face for the label. If the boolean value false is
passed as the parameter, then the font will become "Arial,Helvetica,sans-serif"
which is an ideal font for a label.
</td>
</tr>
<tr>
<a name="setFontSize">
<td>setFontSize</td><td>Numeric</td><td>
This sets the size of the font. The range is 1 to 7.
</td>
</tr>
<tr>
<a name="setText">
<td>setText</td><td>String</td><td>
This sets the text for the label. So you can change a label at any time.
</td>
</tr>

</table>
</body>
</html>